#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main (int argc, char const* argv[])
{
    int i, flg, ans, n, t;

    while (scanf("%d", &n) != EOF) {

        ans = 0;

        while (n--) {
            scanf("%d", &t);

            flg = 1;
            for (i = 2; i <= (int)sqrt(t); i++) {
                if (t % i == 0) {
                    flg = 0; break;
                }
            }

            if (flg == 1) {
                ans++;
            }
        }

        printf("%d\n", ans);
    }

    return 0;
}
